package cn.baiweigang.uu.enums;

public enum TransferTypeEnum {
    futures_to_pro("futures-to-pro", "从合约账户到现货账户"),
    pro_to_futures("pro-to-futures", "从现货账户到合约账户"),
    spot_to_swap("spot_to_swap", "从现货账户到永续合约账户"),
    swap_to_spot("swap_to_spot", "从永续合约账户到现货账户"),
    ;

    private String code;
    private String desc;

    TransferTypeEnum(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static TransferTypeEnum byCode(String code) {
        TransferTypeEnum[] contractTypeEnums = TransferTypeEnum.values();
        for (int i = 0; i < contractTypeEnums.length; i++) {
            if (contractTypeEnums[i].getCode().equalsIgnoreCase(code)) {
                return contractTypeEnums[i];
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
